<html><head>
<title>Install Smooth Gestures: Plugin</title>
<link rel="stylesheet" type="text/css" href="css/base.css" />
<style>

h2 {
margin: .5em;
}

#doubleclick {
position: fixed;
left: 0;
bottom: 0;
max-width: 46%;
margin: 1em 2%;

padding-bottom: .5em;
color: blue;
font-size: .9em;
text-decoration: underline;
cursor: pointer;
}

#installplugin {
position: fixed;
right: 0;
bottom: 0;
width: 46%;
margin: 1em 2%;

padding-top: 1em;
padding-bottom: 1em;
text-align:center;
}

p {
margin: 0 1em .5em;
}

p + p {
color: #666;
}

#arrow {
position: fixed;
bottom: 0;
left: 430px;
font-size: 10em;
color: #00f;
display: none;
}

</style>
<script src="js/jquery.min.js"></script>
</head><body></body><script>

$("body").append($("<h2><img src='im/icon32.png'> Smooth Gestures</h2>"))
         .append($("<p>").text("To use the context menu as usual you must install Smooth Gestures: Plugin"))
         .append($("<p>").text("Alternatively, you can double-click the right mouse button. This is to work around a Chrome bug that normally obstructs Smooth Gestures on Linux or Macs"))

$("body").append($("<div id=doubleclick>").text("Double-click for the Context Menu").click(function() {
  var bg = chrome.extension.getBackgroundPage();
  bg.settings.blockDoubleclickAlert = true;
  bg.saveOptions(bg.profile);
  window.close();
}));
$("body").append($("<div id=installplugin class=button>").text("Install the Plugin").click(function() {
  var bg = chrome.extension.getBackgroundPage();
  bg.settings.blockDoubleclickAlert = false;
  bg.saveOptions(bg.profile);
  var h = window.innerHeight;
  var h2 = null;
  location.href = "http://smoothgestures-chromium.googlecode.com/files/gesturesplugin-0.8.crx";
  $("p, div").css({"display":"none"});
  $("#arrow").css({"display":"block"});
  setInterval(function() {
    if(window.innerHeight < h && (!h2 || window.innerHeight < h2)) h2 = window.innerHeight;
    else if(h2 && window.innerHeight >= h) window.close();
  }, 200);
}));

$("body").append($("<div id=arrow>").html("&darr;"));

</script></html>
